1. Field of the Invention
The present invention relates to a motion image encoding apparatus and method, and more particularly, to a method for adaptively encoding a motion image based on temporal and spatial complexity and an apparatus therefor.
2. Description of the Related Art
As digital video recorders (DVRs) and personal video recorders (PVRs) have become popular and widely used, research on image compression techniques has been actively performed. However, since an image is compressed at a fixed resolution in the conventional DVR and PVR without considering temporal and spatial complexity, the efficiency of compression is low.
FIG. 1 is a block diagram of a conventional motion image encoding system. First, input image data is divided into 8×8 pixel blocks. In order to remove spatial correlation, a discrete cosine transform (DCT) unit 110 performs DCT operations on image data being input in units of 8×8 pixel blocks. By quantizing DCT coefficients obtained in the DCT unit 120, a quantization unit (Q) 120 expresses the DCT coefficients by some representative values such that high-efficiency lossy compression is performed. A variable length encoding (VLC) unit 130 entropy-codes the quantized DCT coefficients and outputs an entropy-coded data stream.
An inverse quantization (IQ) unit 140 inverse quantizes the image data that is quantized in the quantization unit 120. An inverse DCT (IDCT) unit 150 IDCT transforms the image data that is inversely quantized in the inverse quantization (IQ) unit 140. A frame memory unit 160 stores the image data that is IDCT transformed in the IDCT unit 150, in units of frames. A motion estimation (ME) unit 170 removes temporal correlations by using image data of a current frame that is being input and image data of a previous frame that is stored in the frame memory unit 160.
For data compression, an MPEG-2 encoder, as shown in FIG. 1, is used in conventional DVRs and PVRs. When input data is not compressed, the data is compressed through the MPEG-2 encoder and the bit stream is stored in a storage medium such as a hard disc drive (HDD) or a digital versatile disc (DVD). When input image data is a compressed bit stream, in order to generate an MPEG-2 stream with desired conditions by using a motion image transcoder shown in FIG. 2, MPEG-2 motion image is decoded and then, a predetermined scale and format transform is performed. Then, MPEG-2 motion image encoding is performed.
FIG. 2 is a block diagram of a conventional transcoding apparatus. When input image data is a compressed bit stream, image data is decoded by a motion image decoder 220 which comprises a variable length decoding (VLD) unit 222, an inverse quantization unit 224, an IDCT unit 226, a frame memory 228, and a motion compensation (MC) unit 230. Then, in order to generate an MPEG-2 stream with desired conditions, the motion image is encoded at a predetermined resolution by using the same MPEG-2 encoder as the motion image encoder shown in FIG. 1. This process is referred to as transcoding. When transcoding is performed, a scale and format transform unit 240 is used to reduce the scale of the image or convert the format of the image decoded by the motion image decoder 220, if necessary. Then, the MPEG-2 encoder 260 is used to perform MPEG-2 encoding at a predetermined resolution.
Thus, in the conventional MPEG-2 encoding, encoding is always performed with constant resolution. Accordingly, whether spatial complexity is large according to the characteristic of an input motion image or not, encoding is always performed with the same resolution. Also, even though a motion image has little temporal change, a high frame rate of 30 Hz is maintained, decreasing the efficiency of encoding.